package com.tjsinfo.tjsoa.system.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tjsinfo.tjsoa.system.bo.ISystemAllGroupBO;

public class IsSameAllGroupNameAction extends Action {
	private ISystemAllGroupBO systemAllGroupBO;

	

	public ISystemAllGroupBO getSystemAllGroupBO() {
		return systemAllGroupBO;
	}



	public void setSystemAllGroupBO(ISystemAllGroupBO systemAllGroupBO) {
		this.systemAllGroupBO = systemAllGroupBO;
	}



	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		// TODO Auto-generated method stub
		request.setCharacterEncoding("UTF-8");
		Integer id = Integer.parseInt(request.getParameter("id")); 
		String allgroupnaem = new String(request.getParameter("groupName").getBytes(
				"ISO-8859-1"), "UTF-8");
		
		if (systemAllGroupBO.isSameSystemAllGroupName(id,allgroupnaem)) {
			response.getWriter().print(false);
		} else {
			response.getWriter().print(true);
		}
		return null;
	}

}
